package com.example.sxt_practise.GOF23.builder;

/**
 * @author gaofeng
 * @date 2022年05月21日 10:21
 */
public class MoZhouAirShipDirector implements AirShipDirector{

    private final AirShipBuilder airShipBuilder ;

    public MoZhouAirShipDirector(AirShipBuilder builder) {
        airShipBuilder = builder ;
    }

    @Override
    public AirShip buildAirShip() {
        Engine engine = airShipBuilder.buildEngine();
        EscapeTower escapeTower = airShipBuilder.buildEscapeTower();
        OrbitalModule orbitalModule = airShipBuilder.buildOrbitalModule();

        return new AirShip(orbitalModule, engine, escapeTower);
    }
}
